﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using RG.Common;
using RG.Common.WPF.Filters.ToolBarFilters;

namespace RG.Consts
{

    public interface IApartment<TManager, TMicroArea>
        where TManager :class, IManager
        where TMicroArea : class, IMicroArea
    { 
        /// <summary>
        /// Код
        /// </summary>
        [DataMember]
        int Id { get; set; }

        /// <summary>
        /// Менеджер
        /// </summary>
        [DataMember]
        TManager Manager { get; set; }

        /// <summary>
        /// Количество комнат
        /// </summary>
        [DataMember]
        int CountOfRooms { get; set; }

        /// <summary>
        /// Район
        /// </summary>
        [DataMember]
        AreasOfTheCity Area { get; set; }

        /// <summary>
        /// МикроРайон
        /// </summary>
        [DataMember]
        TMicroArea MicroArea { get; set; }

        /// <summary>
        /// Цена
        /// </summary>
        [DataMember]
        decimal Cost { get; set; }

        /// <summary>
        /// Площадь
        /// </summary>
        [DataMember]
        decimal Square { get; set; }

        /// <summary>
        /// Этажность
        /// </summary>
        [DataMember]
        int NumberOfStoreys { get; set; }

        /// <summary>
        /// Этаж
        /// </summary>
        [DataMember]
        int Floor { get; set; }

        /// <summary>
        /// Материал
        /// </summary>
        [DataMember]
        TypeOfMaterial TypeOfMaterial { get; set; }

        /// <summary>
        /// Дата создания
        /// </summary>
        [DataMember]
        DateTime CreateDate { get; set; }

        /// <summary>
        /// Время создания
        /// </summary>
        [DataMember]
        DateTime CreateTime { get; set; }

        /// <summary>
        /// Состояние
        /// </summary>
        [DataMember]
        ApartmentState State { get; set; }

        /// <summary>
        /// Описание
        /// </summary>
        [DataMember]
        string Description { get; set; }

        /// <summary>
        /// Адрес
        /// </summary>
        [DataMember]
        string Address { get; set; }
    }

    [DataContract]
    public class ApartmentsQueryParams : IParam
    {
        [DataMember]
        public List<int> Ids { get; set; }
        [DataMember]
        public string ManagerName { get; set; }
        [DataMember]
        public List<int> Rooms { get; set; }
        [DataMember]
        public List<AreasOfTheCity> Areas { get; set; }
        [DataMember]
        public string MicroAreaName { get; set; }
        [DataMember]
        public List<TypeOfMaterial> Materials { get; set; }
        [DataMember]
        public DatesRange Date { get; set; }
        [DataMember]
        public List<ApartmentState> States { get; set; }
        [DataMember]
        public Interval<int> Floor { get; set; }
        [DataMember]
        public Interval<int> NumberOfStoreys { get; set; }
        [DataMember]
        public Interval<decimal> Cost { get; set; }
        [DataMember]
        public Interval<decimal> Square { get; set; }
        [DataMember]
        public string Address { get; set; }
    }
}
